package com.yuchen.ishop.web.admin;

import com.yuchen.ishop.service.admin.sys.MenuService;
import com.yuchen.ishop.web.BaseAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * 菜单
 */
@Controller
@RequestMapping(value = "/admin/menu")
public class MenuAction extends BaseAction {

    @Autowired
    private MenuService menuService;

    @RequestMapping(value = "/menuJson")
    @ResponseBody
    public Map menuJson(ModelMap modelMap)throws Exception {
        Map map = new HashMap(1);
        map.put("menu",menuService.find());
        return map;
    }


}
